getBlogList();

function getBlogList(){
    $(".container .right").empty();
    $.ajax({
        type: "get",
        url: "/blog/getbloglist",
        success: function (ret){
            if(ret==null || ret.code != 200){
                return;
            }
            var finalhtml = '';
            for(bloglist of ret.data){
                finalhtml += '<div class="blog">';
                finalhtml += '<div class="title">'+bloglist.title+'</div>';
                finalhtml += '<div class="date">'+bloglist.createTime+'</div>';
                finalhtml += '<div class="desc">'+bloglist.content+'</div>';
                finalhtml += '<a class="detail" href="blog_detail.html?blogId='+bloglist.id+'">查看全文&gt;&gt;</a>';
                finalhtml += '</div>';
            }
            $(".container .right").html(finalhtml);
        }
    });
}

//
// <div className="blog">
//     <div className="title">我的第一篇博客</div>
//     <div className="date">2021-06-02</div>
//     <div className="desc">今天开始, 好好学习Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quas nesciunt, hic
//         voluptatum, dolorem quisquam modi accusantium, commodi dolores architecto ratione vel exercitationem optio.
//         Facere repellendus autem, obcaecati dolore sequi incidunt?
//     </div>
//     <a className="detail" href="blog_detail.html">查看全文&gt;&gt;</a>
// </div>

